﻿using System;
using System.Reflection;
using MySql.Simple.Mapper.Attributes;
using MySql.Simple.Mapper.Structures;

namespace MySql.Simple.Mapper.Types
{
    /// <summary>
    /// Interface to define a link in the chain of responsibility to map .NET types to MySQL types
    /// </summary>
    public interface ITypeLink
    {
        /// <summary>
        /// Determines whether this link is responsible for mapping the specified type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <returns>
        /// 	<c>true</c> if the specified type is responsible; otherwise, <c>false</c>.
        /// </returns>
        bool IsResponsible(PropertyInfo type);

        /// <summary>
        /// Maps the specified column.
        /// </summary>
        /// <param name="column">The column.</param>
        /// <param name="columnAttribute">The column attribute.</param>
        /// <returns></returns>
        Column Map(Column column, ColumnAttribute columnAttribute);
    }
}
